//
//  DailyStoryTableViewCell.m
//  GOGOTravel
//
//  Created by dllo on 16/1/25.
//  Copyright © 2016年 果果. All rights reserved.
//

#import "DailyStoryTableViewCell.h"

@implementation DailyStoryTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
    }
    return self;
}

- (void)setModel:(DailyStory *)model{
    
    if (_model != model) {
        [_model release];
        _model = [model retain];
        
    }
    _image.layer.cornerRadius = 10;
    _image.layer.masksToBounds = YES;
    //        _backImage.image = [UIImage imageNamed:@"04b276942e35e254729594c183b7a35d.jpg"];
    
    _logoImage.layer.cornerRadius = 25.1;
    _logoImage.layer.masksToBounds = YES;
    [self setValues];
    
    
}

- (void)setValues{
    
    [_image sd_setImageWithURL:[NSURL URLWithString:_model.index_cover] placeholderImage:[UIImage imageNamed:PLACE_HLODER]];
    
    NSDictionary *dic = _model.user;
    [_logoImage sd_setImageWithURL:[NSURL URLWithString:dic[@"avatar_m"]] placeholderImage:[UIImage imageNamed:PLACE_HLODER]];
    
    _label1.text = _model.index_title;
    
    _label2.text = dic[@"name"];
    
    
}


- (void)layoutSubviews{
    
    [super layoutSubviews];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc {
    [_backImage release];
    [_logoImage release];
    [_image release];
    [_label1 release];
    [_label2 release];
    [super dealloc];
}
@end
